class CreateStoreStaffEvents < ActiveRecord::Migration[5.0]
  def change
    create_table :store_staff_events do |t|
      t.integer :store_id
      t.integer :store_staff_id
      t.integer :sort, default: 0
      t.string  :type
      t.float :hour
      t.datetime :started_at
      t.datetime :ended_at
      t.decimal :amount
      t.integer :creator_id
      t.string  :remark
      t.datetime :occur_on

      t.timestamps
    end
    add_index :store_staff_events, :store_staff_id
    add_index :store_staff_events, :started_at
    add_index :store_staff_events, :occur_on
  end
end
